extends Control


# Called when the node enters the scene tree for the first time.
var select:int = 0
func _ready() -> void:
	
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	if GameData.cWorld =="主界面":
		keys()
	pass
func keys():
	if Input.is_action_just_pressed("上"):
		select-=1
	if Input.is_action_just_pressed("下"):
		select+=1
	if select<0:
		select =0
	if select >5:
		select = 5
	if Input.is_action_just_pressed("发射"):
		print(get_child(select).name)
		selectMode(get_child(select).name)
	for i in range(0,6):
		if i == select:
			get_child(i).material.blend_mode = 2
		else:
			get_child(i).material.blend_mode = 0
func selectMode(mode:String = "GameStart"):
	match mode:
		"GameStart":
			#var gameworld = load("res://Files/StageMap/游戏地图.tscn").instantiate()
			#GameData.world.add_child(gameworld)
			GameData.cWorld="主界面→选关"
			self.visible = false
			pass
			
